package com.qf.service.impl;

import com.qf.dao.SCMusicRespository;
import com.qf.pojo.SCMusic;
import com.qf.service.SCMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SCMusicServiceImpl implements SCMusicService {
    @Autowired(required = false)
    SCMusicRespository scMusicRespository;

    @Override
    public List<SCMusic> findAll() {
        return scMusicRespository.findAll();
    }

    @Override
    public List<SCMusic> findByUid(Integer id) {
        return scMusicRespository.findByUid(id);
    }

    @Override
    public SCMusic addAndUpdate(SCMusic scMusic) {
        return scMusicRespository.saveAndFlush(scMusic);
    }

    @Override
    public void delete(Integer id) {
        scMusicRespository.deleteById(id);
    }
}
